<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>linux常用命令 | Threadv</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="linux常用命令Linux的目录结构123456789101112131415161718192021222324bin  (binaries)存放二进制可执行文件sbin  (super user binaries)存放二进制可执行文件，只有root才能访问etc (etcetera)存放系统配置文件usr  (u">
<meta name="keywords" content="linux">
<meta property="og:type" content="article">
<meta property="og:title" content="linux常用命令">
<meta property="og:url" content="http://yoursite.com/2019/06/12/linux常用命令/index.html">
<meta property="og:site_name" content="Threadv">
<meta property="og:description" content="linux常用命令Linux的目录结构123456789101112131415161718192021222324bin  (binaries)存放二进制可执行文件sbin  (super user binaries)存放二进制可执行文件，只有root才能访问etc (etcetera)存放系统配置文件usr  (unix shared resources)用于存放共享的系统资源home 存放用">
<meta property="og:updated_time" content="2020-03-29T11:01:38.418Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="linux常用命令">
<meta name="twitter:description" content="linux常用命令Linux的目录结构123456789101112131415161718192021222324bin  (binaries)存放二进制可执行文件sbin  (super user binaries)存放二进制可执行文件，只有root才能访问etc (etcetera)存放系统配置文件usr  (unix shared resources)用于存放共享的系统资源home 存放用">
  
    <link rel="alternate" href="/atom.xml" title="Threadv" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Threadv</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Suche"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-linux常用命令" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/06/12/linux常用命令/" class="article-date">
  <time datetime="2019-06-12T07:09:11.000Z" itemprop="datePublished">2019-06-12</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      linux常用命令
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h4 id="linux常用命令"><a href="#linux常用命令" class="headerlink" title="linux常用命令"></a>linux常用命令</h4><h6 id="Linux的目录结构"><a href="#Linux的目录结构" class="headerlink" title="Linux的目录结构"></a>Linux的目录结构</h6><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">bin  (binaries)存放二进制可执行文件</span><br><span class="line"></span><br><span class="line">sbin  (super user binaries)存放二进制可执行文件，只有root才能访问</span><br><span class="line"></span><br><span class="line">etc (etcetera)存放系统配置文件</span><br><span class="line"></span><br><span class="line">usr  (unix shared resources)用于存放共享的系统资源</span><br><span class="line"></span><br><span class="line">home 存放用户文件的根目录</span><br><span class="line"></span><br><span class="line">root  超级用户目录</span><br><span class="line"></span><br><span class="line">dev (devices)用于存放设备文件</span><br><span class="line"></span><br><span class="line">lib  (library)存放跟文件系统中的程序运行所需要的共享库及内核模块</span><br><span class="line"></span><br><span class="line">mnt  (mount)系统管理员安装临时文件系统的安装点</span><br><span class="line"></span><br><span class="line">boot 存放用于系统引导时使用的各种文件</span><br><span class="line"></span><br><span class="line">tmp  (temporary)用于存放各种临时文件</span><br><span class="line"></span><br><span class="line">var  (variable)用于存放运行时需要改变数据的文件</span><br></pre></td></tr></table></figure>
<h6 id="Linux常用命令"><a href="#Linux常用命令" class="headerlink" title="Linux常用命令"></a>Linux常用命令</h6><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">命令格式：命令  -选项  参数 （选项和参数可以为空）</span><br></pre></td></tr></table></figure>
<ul>
<li>文件及目录</li>
</ul>
<table>
<thead>
<tr>
<th>命令</th>
<th>参数</th>
<th>示例</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>cd</td>
<td>-</td>
<td>cd /usr</td>
<td>切换目录</td>
</tr>
<tr>
<td>pwd</td>
<td>-</td>
<td>pwd</td>
<td>当前目录</td>
</tr>
<tr>
<td>touch</td>
<td>-</td>
<td>touch a.java</td>
<td>创建空文件</td>
</tr>
<tr>
<td>mkdir</td>
<td>-</td>
<td>mkdir dir</td>
<td>创建新目录</td>
</tr>
<tr>
<td>mkdir</td>
<td>-p</td>
<td>mkdir -p /usr/dir/java</td>
<td>创建多级目录</td>
</tr>
<tr>
<td>cp</td>
<td>-</td>
<td>cp a.java /usr</td>
<td>复制文件或目录</td>
</tr>
<tr>
<td>cp</td>
<td>-r</td>
<td>cp -f /usr/dir/a.txt /root</td>
<td>递归处理</td>
</tr>
<tr>
<td>rmdir</td>
<td>-</td>
<td>rmdir dirxx</td>
<td>删除空目录</td>
</tr>
<tr>
<td>more</td>
<td>-</td>
<td>more a.txt</td>
<td>分页显示文本文件内容 空格后，b向前</td>
</tr>
<tr>
<td>less</td>
<td>-</td>
<td>less a.txt</td>
<td>同上，支持底行</td>
</tr>
<tr>
<td>head</td>
<td>-</td>
<td>head a.txt</td>
<td>查看开头 默认10行</td>
</tr>
<tr>
<td>head</td>
<td>-num</td>
<td>head -20 a.txt</td>
<td>查看开头指定行</td>
</tr>
<tr>
<td>tail</td>
<td>-</td>
<td>tail a.txt</td>
<td>查看文本结尾，默认10行</td>
</tr>
<tr>
<td>tail</td>
<td>-num</td>
<td>tail -20 a.txt</td>
<td>查看文本结尾，指定行数</td>
</tr>
<tr>
<td>tail</td>
<td>-f</td>
<td>tail a.txt</td>
<td>循环滚动读取并动态显示</td>
</tr>
<tr>
<td>wc</td>
<td>-</td>
<td>wc a.txt</td>
<td>统计文本的行数，字数，字符数</td>
</tr>
<tr>
<td>wc</td>
<td>-m</td>
<td>wc -m a.txt</td>
<td>字符数</td>
</tr>
<tr>
<td>wc</td>
<td>-w</td>
<td>wc -w a.txt</td>
<td>文本字数</td>
</tr>
<tr>
<td>wc</td>
<td>-l</td>
<td>cd -l a.txt</td>
<td>文本行数</td>
</tr>
<tr>
<td>find</td>
<td>-name</td>
<td>find / -name a.txt</td>
<td>指定目录查文件</td>
</tr>
</tbody>
</table>
<ul>
<li>vi / vim</li>
</ul>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>i</td>
<td>光标前插入</td>
</tr>
<tr>
<td>l</td>
<td>在光标当前行开始插入</td>
</tr>
<tr>
<td>a</td>
<td>光标后插入</td>
</tr>
<tr>
<td>A</td>
<td>在光标当前行末尾插入</td>
</tr>
<tr>
<td>o</td>
<td>在当前行下一行插入</td>
</tr>
<tr>
<td>O</td>
<td>在当前行上一行插入</td>
</tr>
<tr>
<td>:wq</td>
<td>保存退出</td>
</tr>
<tr>
<td>:q</td>
<td>退出</td>
</tr>
</tbody>
</table>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/06/12/linux常用命令/" data-id="cka9lj6d2004l9kuwqar14tkw" class="article-share-link">Teilen</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/linux/">linux</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/08/03/pytes_基础/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Neuer</strong>
      <div class="article-nav-title">
        
          pytest—基础知识
        
      </div>
    </a>
  
  
    <a href="/2019/06/10/反转单链表/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Älter</strong>
      <div class="article-nav-title">反转单链表</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Design-Patterns/">Design Patterns</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/">Git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Html/">Html</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Http/">Http</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Sort/">Sort</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/algorithm/">algorithm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ali-weixin-pay/">ali/weixin pay</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/elasticsearch/">elasticsearch</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/idea/">idea</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jvm/">jvm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logstash/">logstash</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mysql/">mysql</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/php/">php</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pytest/">pytest</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/springboot/">springboot</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/util/">util</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vue/">vue</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wechat/">wechat</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/我的世界/">我的世界</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/消息队列/">消息队列</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/线程/">线程</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Design-Patterns/" style="font-size: 16.36px;">Design Patterns</a> <a href="/tags/Git/" style="font-size: 10px;">Git</a> <a href="/tags/Html/" style="font-size: 10px;">Html</a> <a href="/tags/Http/" style="font-size: 12.73px;">Http</a> <a href="/tags/JavaScript/" style="font-size: 15.45px;">JavaScript</a> <a href="/tags/Sort/" style="font-size: 18.18px;">Sort</a> <a href="/tags/algorithm/" style="font-size: 11.82px;">algorithm</a> <a href="/tags/ali-weixin-pay/" style="font-size: 13.64px;">ali/weixin pay</a> <a href="/tags/docker/" style="font-size: 17.27px;">docker</a> <a href="/tags/elasticsearch/" style="font-size: 10px;">elasticsearch</a> <a href="/tags/go/" style="font-size: 11.82px;">go</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/idea/" style="font-size: 10px;">idea</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/jvm/" style="font-size: 11.82px;">jvm</a> <a href="/tags/linux/" style="font-size: 16.36px;">linux</a> <a href="/tags/logstash/" style="font-size: 12.73px;">logstash</a> <a href="/tags/mysql/" style="font-size: 14.55px;">mysql</a> <a href="/tags/php/" style="font-size: 11.82px;">php</a> <a href="/tags/pytest/" style="font-size: 10px;">pytest</a> <a href="/tags/python/" style="font-size: 13.64px;">python</a> <a href="/tags/springboot/" style="font-size: 17.27px;">springboot</a> <a href="/tags/util/" style="font-size: 19.09px;">util</a> <a href="/tags/vue/" style="font-size: 10px;">vue</a> <a href="/tags/wechat/" style="font-size: 10.91px;">wechat</a> <a href="/tags/我的世界/" style="font-size: 10px;">我的世界</a> <a href="/tags/消息队列/" style="font-size: 10.91px;">消息队列</a> <a href="/tags/线程/" style="font-size: 11.82px;">线程</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archiv</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">May 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">April 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/03/">March 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">January 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">October 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/02/">February 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/01/">January 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/12/">December 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/11/">November 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/10/">October 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/09/">September 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/07/">July 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/06/">June 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/05/">May 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/04/">April 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/03/">March 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/">February 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/01/">January 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/">December 2017</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">letzter Beitrag</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/05/16/linux_awk_sed/">linux-awk\sed 示例</a>
          </li>
        
          <li>
            <a href="/2020/04/11/linux_bash/">linux—bash</a>
          </li>
        
          <li>
            <a href="/2020/03/29/hello-world/">Hello World</a>
          </li>
        
          <li>
            <a href="/2020/03/16/go基础/">go基础知识</a>
          </li>
        
          <li>
            <a href="/2020/03/16/go安装和配置/">go安装和配置</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 chen v<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>